-- GENERATED SPELL FOR [Stormwind Mage] --


function spell0_18949(pUnit, Event) --@Arcane Missiles,n/a--
pUnit:FullCastSpellOnTarget(33462,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18949', 651, 1)
end

function spell1_18949(pUnit, Event) --@Blizzard,n/a--
pUnit:FullCastSpellOnTarget(33624,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18949', 12000, 1)
end

function spell2_18949(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(33417,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18949', 3000, 1)
end

function Sorts_18949(pUnit, Event)
local choix_sorts_18949 = math.random(0, 2)
if choix_sorts_18949 == 0 then
pUnit:RegisterEvent('spell0_18949', 1, 1)
end
if choix_sorts_18949 == 1 then
pUnit:RegisterEvent('spell1_18949', 1, 1)
end
if choix_sorts_18949 == 2 then
pUnit:RegisterEvent('spell2_18949', 1, 1)
end
end

function mob18949_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18949', math.random(1500, 3000), 1)
end

function mob18949_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18949_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18949_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18949, 1, 'mob18949_Action')
RegisterUnitEvent(18949, 2, 'mob18949_Leave')
RegisterUnitEvent(18949, 3, 'mob18949_Kill')
RegisterUnitEvent(18949, 4, 'mob18949_Die')
